﻿namespace Devonline.Identity
{
    /// <summary>
    /// Provides global options for the Data Protection system.
    /// </summary>
    public class DataProtectionOptions
    {
        public DataProtectionOptions()
        {
            KeyName = "devonline.identity.data_protection_keys";
            ApplicationName = "devonline.identity";
            ApplicationDiscriminator = "devonline.identity";
            ExpireDay = 90;
            KeyDerivationIterationCount = 102400;
        }

        /// <summary>
        /// redis configuration options
        /// </summary>
        public string Redis { get; set; }
        /// <summary>
        /// DataProtection redis key name
        /// </summary>
        public string KeyName { get; set; }
        /// <summary>
        /// data protection application name
        /// </summary>
        public string ApplicationName { get; set; }
        /// <summary>
        /// An identifier that uniquely discriminates this application from all other
        /// applications on the machine. The discriminator value is implicitly included
        /// in all protected payloads generated by the data protection system to isolate
        /// multiple logical applications that all happen to be using the same key material.
        /// </summary>
        /// <remarks>
        /// If two different applications need to share protected payloads, they should
        /// ensure that this property is set to the same value across both applications.
        /// </remarks>
        public string ApplicationDiscriminator { get; set; }
        /// <summary>
        /// 有效期天数
        /// </summary>
        public int ExpireDay { get; set; }
        /// <summary>
        /// the key password
        /// </summary>
        public string KeyPassword { get; set; }
        /// <summary>
        /// the sign password
        /// </summary>
        public string SignPassword { get; set; }
        /// <summary>
        /// The number of iterations of the pseudo-random function to apply during the key derivation process.
        /// </summary>
        public int KeyDerivationIterationCount { get; set; }
    }
}
